subroutine set_point_type(lunit,id,str)
  use global_param,only:pdefect
  use global_param,only:n_point_type
  implicit none

  integer,intent(in) :: lunit,id
  character :: str*(*)

  integer :: i,n,a

  pdefect(id)%ch=trim(adjustl(str))
  n=len_trim(str)
  pdefect(id)%len=n
  allocate(pdefect(id)%lowercase(n))
  allocate(pdefect(id)%uppercase(n))

  do i=1,n
     a=ichar(pdefect(id)%ch(i:i))
     if (a.ge.65.and.a.le.90) then
        pdefect(id)%uppercase(i)=a
        pdefect(id)%lowercase(i)=a+32
     else if (a.ge.97.and.a.le.122) then
        pdefect(id)%lowercase(i)=a
        pdefect(id)%uppercase(i)=a-32
     else if (a.ge.48.and.a.le.57) then
        pdefect(id)%lowercase(i)=a
        pdefect(id)%uppercase(i)=a
     else
        call abnormal_stop("set_point_type",&
             "Unallowed point defect is defined.")
     end if
  end do

  return

end subroutine set_point_type
